const mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/play', { useNewUrlParser: true, useUnifiedTopology: true })
    .then(result => console.log('连接成功'))
    .catch(err => console.log(err, '连接失败'))